﻿@model PagedList.IPagedList<SIFIET.Models.User> 

@{
    ViewBag.Title = "Usuarios";
}
<h2>
    Usuarios Registrados

</h2>

@*Busqueda *@

@*--------------------------------------------------------------------------------------------------------------------------------------*@
<form method="get" class = "rigth" action="/User/Search">
        <div class="editor-field">
          @Html.TextBox("nameuser", ViewBag.CurrentFilter as string) 

          <div class="left"> @Html.ActionLink(" ", " ", null, htmlAttributes: new { @class = "btnsearch", title = "Buscar Usuario" }) &nbsp</div>
                
          <input type="submit" value="Buscar" class="ebutton blue" /> 
        </div>
</form>
@*--------------------------------------------------------------------------------------------------------------------------------------*@
<p>
    @Html.ActionLink("Registrar Nuevo Usuario", "Register", "", htmlAttributes: new { @class = "ebutton blue" })&nbsp
    @Html.ActionLink("Regresar", "Out", "Verify", "", htmlAttributes: new { @class = "ebutton blue" })
    <div class="alert success">@TempData["Editar"]</div>
    <div class="alert success">@TempData["Creado"]</div>
    <div class="alert success">@TempData["Estado"]</div>
    <div class="alert success">@TempData["Success"]</div> 
</p>

<table>
    <tr>
        <th>
            Nombres
        </th>
        <th>
            Apellidos
        </th>
        <th>
            Dirección
        </th>
        <th>
            Celular
        </th>
        <th >
            Opciones
        </th>
    </tr>
    @{ int i = 0;}
    @foreach (var item in Model)
    {
        if (i % 2 == 0)
        {
            @:<tr>
        }
        else
        {
             @:<tr class="even">
        }
            <td>
                @Html.DisplayFor(modelItem => item.FirstNames)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastNames)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Address)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CellphoneNumber)
            </td>
            <td>
            <div>
                <div class="left"> @Html.ActionLink(" ", "Edit", new { id = item.Id }, htmlAttributes: new { @class = "btnedit", title = "Editar Perfil" }) &nbsp</div>
                <div class="left"> @Html.ActionLink(" ", "Details", new { id = item.Id }, htmlAttributes: new { @class = "btndetails", title = "Ver Perfíl" }) &nbsp</div>
                </div>&nbsp

                <div class="c1">
                <div class="boton">
                 &#9660;                               
                    <div class="informa">
                         <div class="contenido">
                               <div class="arrow_box"></div>
                                <div class="titulo">Más opciones</div>
                                <ul>
                                   <li class="lmenu">
                                      @Html.ActionLink("Asignar Roles", "AssignUserRoles", "UsersRoles", new { id = item.Id }, null)
                                   </li>
                                </ul>
                                <ul>
                                   <li class="lmenu">
                                      @Html.ActionLink("Perfil del Usuario", "Begin", new { id = item.Id }, null)
                                   </li>
                                </ul>	
                                <ul>
                                   <li class="lmenu">
                                      @Html.ActionLink("Cambiar Estado", "State", new { id = item.Id }, null)                 
                                   </li>
                                </ul>
                          </div>
                     </div>
                 </div>
                 </div>

            </td>
        @:</tr>
                          i++;
    }
</table>
<div></div>
 <div>
    Página @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    de @Model.PageCount
     
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1 })
        @Html.Raw(" ");
        @Html.ActionLink("< Anterior", "Index", new { page = Model.PageNumber - 1 })
    }
    else
    {
        @:<<
        @Html.Raw("   ");
        @:< Anterior
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Siguiente>", "Index", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount })
    }
    else
    {
        @:Siguiente >
        @Html.Raw(" ")
        @:>>
    }
    </div>

<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" 

type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/menu.js")" type="text/javascript"></script>
